/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.gephi.statistics.spi;

import javax.swing.JPanel;
import org.openide.util.lookup.ServiceProvider;

/**
 *
 * @author lczgywzyy
 */
@ServiceProvider(service = StatisticsUI.class)
public class CSMetricUI implements StatisticsUI {

    private CSMetricPanel panel;
    private CSMetric myMetric;

    @Override
    public String getDisplayName() {
        return "CSMetric_UI";
    }

    @Override
    public String getCategory() {
        return StatisticsUI.CATEGORY_NETWORK_OVERVIEW;
    }

    @Override
    public int getPosition() {
        return 800;
    }

    @Override
    public Class<? extends Statistics> getStatisticsClass() {
        return CSMetric.class;
    }

    @Override
    public JPanel getSettingsPanel() {
        panel = new CSMetricPanel();
        return panel;
    }

    @Override
    public void setup(Statistics statistics) {
        this.myMetric = (CSMetric) statistics;
        if (panel != null) {
            panel.setDirected(myMetric.isDirected());
        }
    }

    @Override
    public void unsetup() {
        if (panel != null) {
            myMetric.setDirected(panel.isDirected());
        }
        panel = null;
    }

    @Override
    public String getValue() {
        return null;
    }

    @Override
    public String getShortDescription() {
        return "shord description!!";
    }

}
